import Vue from 'vue'
import VueRouter from 'vue-router'

import LayoutPage from '../views/LayoutPage.vue'
import HomePage from '../views/HomePage.vue'
import QuestionPage from '../views/QuestionPage.vue'
import VideoPage from '../views/VideoPage.vue'
import LoginPage from '../views/LoginPage.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: LayoutPage,
    redirect: 'home',
    children: [
      { path: 'home', component: HomePage },
      { path: 'question', component: QuestionPage },
      { path: 'video', component: VideoPage },
      { path: 'user', component: LoginPage }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
